package com.simon.train.common.exception;

public class BusinessException extends RuntimeException{

    private BusinessExceptionEnum businessExceptionEnum;

    public BusinessException(BusinessExceptionEnum businessExceptionEnum) {
        this.businessExceptionEnum = businessExceptionEnum;
    }

    public BusinessExceptionEnum getBusinessExceptionEnum() {
        return businessExceptionEnum;
    }

    public void setBusinessExceptionEnum(BusinessExceptionEnum businessExceptionEnum) {
        this.businessExceptionEnum = businessExceptionEnum;
    }

    /**
     * 重写RuntimeException的方法
     * 不写入堆栈信息 提高性能
     * 因为业务异常我们本身知道报错点 所以不需要在终端显示具体原因了
     * @return
     */
    @Override
    public Throwable fillInStackTrace(){
        return this;
    }

}
